import VueRouter from "./index"
import Vue from "vue"
// 启用插件
Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'indexPage',
    component: () => import("../pages/Index.vue")
}, {
    path: '/home',
    name: 'indexHome',
    component: () => import("../pages/Home.vue")
}, {
    path: '/about',
    name: 'indexAbout',
    component: () => import("../pages/About.vue")
}]

// 实例化一个路由规则
// 启用以后再去实例化
const router = new VueRouter({
    routes
})

export default router